﻿using System;
using System.Data;
using System.Collections.Generic;
using OnlineManagement.Model;
using OnlineManagement.DALFactory;
using OnlineManagement.IDAL;
namespace OnlineManagement.BLL
{
	/// <summary>
	/// PropagateRecord
	/// </summary>
	public partial class PropagateRecord
	{
		private readonly IPropagateRecord dal=DataAccess.CreatePropagateRecord();
        public PropagateRecord()
        { }
        #region  BasicMethod

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool AddSowPropagateRecord(OnlineManagement.Model.PropagateRecord model, out string returnValue) {
            try
            {
                return dal.AddSowPropagateRecord(model, out returnValue);
            }catch(Exception ex){
                throw ex;
            }
        }
       
		
		#endregion  BasicMethod

		#region  ExtensionMethod

        public int SowPropagate(OnlineManagement.Model.PropagateRecord model, out string message) {
            return dal.SowPropagate(model,out message);
        }

        /// <summary>
        ///  获取可繁殖的母猪信息
        /// </summary>
        /// <param name="hoggeryId"></param>
        /// <returns></returns>
        public DataSet GetPropagateSow(int hoggeryId) {
            return dal.GetPropagateSow(hoggeryId);
        }

        public DataSet GetSpecificSowChildInfo(int hoggeryId, Guid sowId) {
            return dal.GetSpecificSowChildInfo(hoggeryId, sowId);
        }
		#endregion  ExtensionMethod

        #region 已经不再使用
        /// <summary>
        /// 已经不再使用， 获取母猪猪圈名称及母猪饲养员姓名
        /// </summary>
        /// <param name="hoggeryId"></param>
        /// <param name="sowId"></param>
        /// <param name="pigTypeName">返回母猪饲养员姓名</param>
        /// <returns>返回母猪猪圈名称</returns>
        public string GetSowPigPenName(int hoggeryId, Guid sowId, out string feederName)
        {
            try
            {
                return dal.GetSowPigPenName(hoggeryId, sowId, out feederName);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        #endregion
    }
}

